<div id=admin>
<h1>Ajouter une salle</h1>
<?php 
	if ($query_rooms->num_rows() > 0){
		
		$row = $query_rooms->first_row();
		
		?><table><?php
		
		for($y = 1; $y< 5;$y++){
		
			?><tr><?php for($x = 1; $x < 7; $x++){
							if (($row->position_x == $x) and ($row->position_y == $y)){
							// if the room exists in database, we show it on the grid 
							?><td><a id="adm" href="<?php echo site_url();?>/rooms/edit_room/<?php echo $x."/".$y;?>"><span><?=$row->name?></span>Editer</a></td>
							<?php // get the next row
							 $row = $query_rooms->next_row();
							}
							
							else {
							// else we offer to add a room to the expo in this place
					?><td><a href="<?php echo site_url();?>/rooms/add_room/<?php echo $x."/".$y;?>">+</a></td>
					<?php 
				}
		}?>
		</tr><?php
	}?>
</table><?php
	}
	
	?>
	</div>